﻿using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Microsoft.DataTransformationServices.Controls;
using Microsoft.SqlServer.Dts.Runtime;
using Bewise.SmartIndexManagerLT.UI.UserControls;

namespace Bewise.SmartIndexManagerLT.UI.Forms
{
    public class SmartIndexManagerLT_UI_MainWnd : DTSBaseTaskUI
    {
        private const string Title = "Configuration SmartIndexManagerLT_UI";
        private const string Description = "Configures the Connection, Database and Query.";
        private static readonly Icon TaskIcon = new Icon(typeof(SmartIndexManagerLT_IHM), "Task.ico");

        private readonly Uc_MainConfiguration _ucMainConfiguration;

        public SmartIndexManagerLT_UI_MainWnd(TaskHost taskHost, object connections) :
            base(Title, TaskIcon, Description, taskHost, connections)
        {
            InitializeComponent();

            DTSTaskUIHost.FastLoad = false;
            // instanciation de notre UserControl Windows Forms Uc_MainConfiguration
            _ucMainConfiguration = new Uc_MainConfiguration();
            // ajout de notre UserControl dans une vue de notre Host
            DTSTaskUIHost.AddView("Configuration", _ucMainConfiguration, null);
            DTSTaskUIHost.FastLoad = true;
        }

        #region Designer code

        /// <summary>
        /// Required designer variable.
        /// </summary>
        private IContainer components;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            components = new Container();
            AutoScaleMode = AutoScaleMode.Font;
        }

        #endregion
    }
}